<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
  <div id="app">
    <div>foo: {{ searchText }}</div>
    <custom-input v-model="searchText" />
  </div>

  <script>
    const app = Vue.createApp({
      setup() {
        const searchText = Vue.ref('hello')
        return {
          searchText
        }
      }
    })

    app.component('custom-input', {
      props: {
        modelValue: String
      },
      setup(props, context) {
        const value = Vue.computed({
          get: () => props.modelValue,
          set: (val) => context.emit('update:modelValue', val)
        })
        return { value }
      },
      template: `
      <input type="text" v-model="value" />
      `
    })

    app.mount('#app')
  </script>
</body>
</html>